import inspect

from config.config import base_cfg, font_cfg
from text_renderer.config import (
    FixedTextColorCfg,
)
from text_renderer.corpus import CharCorpus, CharCorpusCfg
from text_renderer.effect import *


def chn_data():
    return base_cfg(
        inspect.currentframe().f_code.co_name,
        corpus=get_char_corpus(),
        corpus_effects=Effects(
            [
                Line(0.5, color_cfg=FixedTextColorCfg()),
                OneOf([DropoutRand(), DropoutVertical()]),
            ]
        ),
    )


def get_char_corpus():
    return [CharCorpus(
        CharCorpusCfg(
            text_paths=None,
            filter_by_chars=True,
            length=(5, 10),
            char_spacing=(-0.3, 1.3),
            chars_file=None, auto_load_chars=False, **font_cfg
        )
    )]


# fmt: off
# The configuration file must have a configs variable
configs = [
    chn_data(),
]
# fmt: on
